1. Field of the Invention
The present invention relates to an apparatus and method for interpolating and rendering images on mobile devices. More particularly, the present invention relates to an apparatus and method for rendering a high quality interpolated image at a high speed on mobile devices.
2. Description of the Related Art
Mobile terminals were developed to provide wireless communication between users. As technology has advanced, mobile terminals now provide many additional features beyond simple voice communication. For example, mobile terminals are now able to provide additional functions such as Multimedia Message Service (MMS), E-mail, games, digital camera, multimedia function for providing audio and video content, and many more. With the plurality of features now provided, a mobile terminal has effectively become a necessity of daily life.
One aspect of the mobile terminal that has been particularly advanced is the ability to render and process high quality images, such as for a user interface and mobile applications. While the graphics content has become dramatically enriched, and with the fast development of the mobile Internet platform, the graphics functionality of mobile handsets has become an important issue for the handset industry. For example, vector graphics images and animations have become very popular on mobile terminals and essential for smart phones. The rich content of a user interface and mobile applications demands efficient image and graphics rendering methods on the mobile terminals, especially because of their limited processing power. An important rendering method in the mobile graphics platform is image interpolation. Appropriate image interpolation methods apply a geometric transformation, such as rotation, scaling, skewing, and the like on the images to render a smooth output without aliasing.
In 2-Dimensional (2D) image processing, there are several methods by which to interpolate and render an image. Two such methods are nearest neighbor interpolation and bilinear interpolation.
FIG. 1 illustrates an interpolation using the nearest neighbor technique according to the prior art.
Referring to FIG. 1, an image is comprised of a matrix of pixels 100, including a pixel 101. When the image is transformed, for example when the image is enlarged, rotated, and the like, the new pixel matrix is mapped backward to the original image space that includes new pixel 103. To determine the characteristics of pixel 103 using the nearest neighbor technique, the graphics engine on mobile terminal determines which pixel from the original matrix 100 is closest to the location of pixel 103. Having determined that pixel 101 is closest to pixel 103 and thus the nearest neighbor, the mobile terminal applies the characteristics of pixel 101 to new pixel 103.
The nearest neighbor technique, also called the point sampling technique, is a very fast method of transforming an image because the characteristics of the new pixel 103, such as its color value, are simply applied based on the characteristics of its nearest neighbor. In the example of FIG. 1, the characteristics of nearest neighbor pixel 101 are directly applied to the new pixel 103. Accordingly, because its complexity is minimal, the nearest neighbor algorithm can be used to alter an image very quickly. However, despite the quick results, the image quality after a nearest neighbor interpolation is dramatically decreased, especially when the image is zoomed or undergoes a transformation such as rotation or skewing.
FIGS. 2A and 2B illustrate an interpolation using the bilinear technique according to the prior art.
Referring to FIG. 2A, an image is comprised of a matrix of pixels 200, including pixels 220, 221, 222 and 223. When the image is transformed using bilinear interpolation, for example when the image is enlarged, rotated, and the like, a new pixel matrix is mapped backwards to the original image space that includes pixel 203.
Referring to FIG. 2B, bilinear interpolation considers the closest 2×2 matrix of known pixel values surrounding the pixel to be interpolated. In this case, to determine the value of pixel 203, bilinear interpolation considers the 2×2 matrix including pixels 220, 221, 222 and 223. With the known pixel values, a weighted average of these values is used to arrive at a final interpolated value for pixel 203. More specifically, to determine the final interpolated value of pixel 203, the graphics engine performs calculations according to Equation (1).ciA=αci220+(1−α)ci221ciB=αci222+(1−α)ci223ci203=βciA+(1−β)ciB  (1)
In Equation (1), i denotes the color channel (i.e., red, green, blue and alpha), ci denotes the value of the channel, α denotes an interpolation factor according to the horizontal distance, and β denotes an interpolation factor according to the vertical distance.
An advantage of bilinear interpolation is that the transformed image is much smoother than that achieved using the nearest neighbor technique. A disadvantage of bilinear interpolation is the amount of mathematical calculations required to determine a pixel color. The calculation is so expensive in terms of processing steps that it is much slower as compared with the nearest neighbor technique, especially in light of a mobile terminal's limited processing power. As can be deduced from Equation (1), each pixel requires 12 bilinear interpolations including 3 sets of color calculations, wherein each set contains 4 bilinear interpolations for the red, green, blue and alpha channel, respectively. In other words, 24 multiplication instructions and 12 addition instructions plus 5 bitwise logical instructions for decomposing and composing color channels, or, in the alternative, 12 multiplication instructions and 24 addition instructions plus 5 bitwise logical instructions are necessary for each pixel.
Several methods to optimize bilinear interpolation have been proposed, such as parallel calculation. However, the proposed methods still follow the basic interpolation formula and cannot provide a significant improvement in performance, especially on a software based graphics platform that is used on most mobile handsets. Accordingly, as mobile terminals continue to be provided with advanced user interfaces, and as advanced applications become more and more popular, there is a need for an efficient image interpolation method to render images under 2-Dimensional geometric transformation.